#ifndef UIWIN_BASE_ROOT_CONTROL_H_
#define UIWIN_BASE_ROOT_CONTROL_H_

#include "control.h"

namespace uiwin
{
	class WindowEx;

	class DLL_API Layout : public Container
	{
	public:
		Layout(WindowEx* wnd);
		virtual ~Layout();

		bool Load();


		virtual void InvalidateRect(Rect& rc);

	protected:
		virtual void PaintBkColor(PaintDC& dc)
		{
			dc.FillRect(&rcitem_, RGB(240,240,240));
		}

		void PaintText(PaintDC& dc)
		{
			TCHAR info[MAX_PATH];
			_stprintf_s(info, MAX_PATH - 1, _T("Layout paint text width: %d height %d "),
				rcitem_.width(), rcitem_.height());

			Font font;
			font.CreateFont(_T("Consolas"), 10);
			dc.DrawText(info, &rcitem_, DT_RIGHT | DT_BOTTOM | DT_SINGLELINE, font, 255, TRUE);
		}

		WindowEx* window_;
	};
}

#endif	// UIWIN_BASE_ROOT_CONTROL_H_